package com.tmxk.api.days01.days01_wmh.list;

/**
 * @Desscription动态数组集合
 * @Author:wmh
 * @CreateTime:2022-11-28 10:42
 * @Version: 1.0
 */
public class Dog implements Comparable {
    private String name;
    private int age;
    private int health;
    private int love;
    private int weight;
    private int id;;

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Dog() {
    }

    public Dog(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public int compareTo(Object o) {
        Dog dog = (Dog) o;
        return this.getAge() - dog.getAge();
    }
}

